<!--
  Generated template for the item.age page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
      <ion-title>
          库存查询
      </ion-title>
      <ion-buttons end>
          <button ion-button icon-only (click)="scan()">
            <ion-icon name='qr-scanner'></ion-icon>
          </button>
          <button ion-button icon-only (tap)="presentModal($event)"> 
              <ion-icon name='funnel'></ion-icon>
            </button>
      </ion-buttons> 
  </ion-navbar>

</ion-header>


<ion-content>
  <!-- 下拉刷新块 -->
  <ion-refresher (ionRefresh)="doRefresh($event)"> 
      <!-- <ion-refresher-content
          pullingIcon="arrow-dropdown"
          pullingText="下拉刷新"
          refreshingSpinner="circles"
          refreshingText="加载中...">  
        </ion-refresher-content> -->
        <ion-refresher-content >  
        </ion-refresher-content>
  </ion-refresher>

    <ion-searchbar [(ngModel)]="searchValue" (ionInput)="getItems($event)" placeholder="搜索存货"></ion-searchbar>
    <ion-list>
        <ion-item *ngFor="let item of items" (tap)="showDetail(item)">
          <ion-thumbnail item-start>
            <img src="/assets/imgs/product_list_default.png">
          </ion-thumbnail>
          <h2>{{item.sp_store__sp_name}}</h2>
          <p>{{item.sp_store__sp_type}}</p>
          <p>{{item.sp_store__house_name}}</p>
          <ion-badge color="secondary" item-end>{{item.sp_store__store_num | number:'1.2-2'}}</ion-badge> 
          <!-- <button ion-button clear item-end>查看</button> -->
        </ion-item>
      </ion-list>

      <!-- 上拉加载块 -->
      <ion-infinite-scroll (ionInfinite)="doInfinite($event)" immediate-check="false">
        <ion-infinite-scroll-content></ion-infinite-scroll-content>
      </ion-infinite-scroll>
</ion-content>
